<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>DivClosure</title>
    <style>
        body, button {
            margin: 10px;
        }
        div {
            padding: 10px;
        }
    </style>
    <script>

        function eat(food) {
            if (food === "cookies") {
                console.log("More please");
            } else if (food === "cake") {
                console.log("Yum yum");
            }
        }
        (eat)("cookies");
        
        window.onload = function() {
            var count = 0;
            var message = "You clicked me ";
            var div = document.getElementById("message");
            var button = document.getElementById("clickme");

            button.onclick = function() {
                count++;
                div.innerHTML = message + count + " times.";
            };
        }
    </script>
</head>
<body>
    <button id="clickme">Click me!</button>
    <div id="message"></div>
</body>
</html>